<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>优惠券信息</title>
<%@ include file="/page/include.jsp"%>
<link rel="stylesheet" href="<%=basePath%>/statics/css/webform.css?v=20180104" />
</head>
<body class="nav-md" style="background-color: #f7f7f7">
    <div class="container body">
        <div class="main_container">
            <div class="framebody" style="min-height: 100%;" role="main">
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_content">
                                <form class="form-horizontal form-label-left" novalidate id="couponForm" name="couponForm" method="post">
                                    <input type="hidden" id="id" name="id" value="${coupon.id }">
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="couponName">优惠券名称：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.couponName }</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="couponAmount">优惠券面值：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.couponAmount }</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="couponGetDate">优惠券领取时间：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">
                                            <fmt:formatDate value="${coupon.beginGetTime }" type="both" /> ~ <fmt:formatDate value="${coupon.endGetTime }" type="both" />
                                        </label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="timeType">优惠券期限类型：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-6">
                                            <c:forEach items="${timeTypeList }" var="type">
                                                <label class="control-label" for="timeType" style="margin-right:150px;">
                                                    <input name="timeType" value="${type.keyValue }" type="radio"
                                                        <c:if test="${coupon.timeType == type.keyValue }"> checked="true" </c:if>
                                                        class="form-control">
                                                    ${type.keyIntro }
                                                </label>
                                            </c:forEach>
                                        </div>
                                    </div>
                                    <!-- display -->
                                    <c:set var="timeType1Display" value="none"></c:set>
                                    <c:set var="timeType2Display" value="none"></c:set>
                                    <c:choose>
                                        <c:when test="${coupon.timeType == 1 }">
                                            <c:set var="timeType1Display" value="block"></c:set>
                                        </c:when>
                                        <c:when test="${coupon.timeType == 2 }">
                                            <c:set var="timeType2Display" value="block"></c:set>
                                        </c:when>
                                    </c:choose>
                                    <div class="item form-group" id="timeType1" style="display: ${timeType1Display};">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="couponDate">优惠券有效期：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">
                                            <fmt:formatDate value="${coupon.beginTime }" type="both" /> ~ 
                                            <fmt:formatDate value="${coupon.endTime }" type="both" />
                                        </label>
                                    </div>
                                    <div class="item form-group" id="timeType2" style="display: ${timeType2Display};">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="limitDay">有效期限天数：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.limitDay } 天</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="issueNumber">发放数量：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.issueNumber }</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="limitNumber">每人限领：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.limitNumber }</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="conditionAmount">满足金额：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.conditionAmount }</label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="isLimit">上不封顶：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">
                                            <input type="checkbox" name="isLimit" id="isLimit" <c:if test="${coupon.isLimit == 1 }"> checked="true" </c:if> /> <b>上不封顶</b><font color="gray">（如：满100元可使用1张，满200元可使用2张，依次类推）</font>
                                        </label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="isLimit">是否叠加使用：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">
                                            <input type="checkbox" name="isComposition" id="isComposition" <c:if test="${coupon.isComposition == 1 }"> checked="true" </c:if> /> <b>叠加使用</b><font color="gray">（是否可以与其他活动叠加使用）</font>
                                        </label>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-2 col-sm-2 col-xs-2" for="remark">备注：</label>
                                        <label class="control-label col-md-6 col-sm-6 col-xs-6 txtLeft">${coupon.remark }</label>
                                    </div>
                                </form>
                                <div class="ln_solid"></div>
                                <div class="form-btn-content">
                                    <a id="btn_back" class="btn btn-default">返回</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="<%=basePath%>/js/coupon/coupon_view.js"></script>
</html>